package generic_test;

import java.lang.reflect.Field;

/**
 * @author yuisama
 * @date 2022/05/29 14:54
 **/
public class MyClass<T,E extends Number> {
    private T msg;
    private E num;
    public <T> T test(T t) {
        System.out.println(t);
        return t;
    }

    public static void main(String[] args) {
//        MyClass<String> cls1 = new MyClass<>();
//        MyClass<Integer> cls2 = new MyClass<>();
//        System.out.println(cls2.getClass() == cls1.getClass());
        MyClass<String,Integer> myClass = new MyClass<>();
        Class cls = myClass.getClass();
        Field[] fields = cls.getDeclaredFields();
        for (Field field : fields) {
            System.out.println(field.getType());
        }
    }
}

